
def kple(num):
    '''卡普雷尔黑洞'''
    while len(set(str(num))) != 1 and num != 6174:
        max_num = int(''.join(sorted(str(num), reverse=True)))
        min_num = int(''.join(sorted(str(num))))
        num = max_num-min_num
        print(max_num, min_num, num)

if __name__ == '__main__':
      kple(2202)